package com.dwxt.cdms.controller;

import com.dwxt.cdms.base.Page;
import com.dwxt.cdms.entity.HealthSummary;
import com.dwxt.cdms.service.HealthSummaryService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cdms/healthSummary")
public class HealthSummaryController {

    @Autowired
    private HealthSummaryService healthSummaryService;

    /**
     * 健康季度报告分页
     * @param healthSummary
     * @param page
     * @param type
     * @return
     */
    @RequestMapping("/selectHealthSummaryPage")
    public BaseResult selectHealthSummaryPage(HealthSummary healthSummary, Page page, Integer type) {
        return healthSummaryService.selectHealthSummaryPage(healthSummary, page, type);
    }

    @RequestMapping("/selectHealthSummaryByCustomerId")
    public BaseResult selectHealthSummaryByCustomerId(Page page,Integer customerId) {
        return healthSummaryService.selectHealthSummaryByCustomerId(page,customerId);
    }

    /**
     * 修改健康季度分页
     * @param healthSummary
     * @param type
     * @return
     */
    @RequestMapping("/updateHealthSummary")
    public BaseResult updateHealthSummary(HealthSummary healthSummary, Integer type) {
        return healthSummaryService.updateHealthSummary(healthSummary, type);
    }

    /**
     * 查询健康记录分页
     * @param page
     * @param customerId
     * @return
     */
    @RequestMapping("/selectHealthRecordPage")
    public BaseResult selectHealthRecordPage(Page page, Integer customerId) {
        return healthSummaryService.selectHealthRecordPage(page, customerId);
    }

    /**
     * 查询前一个季度报告
     * @param id
     * @return
     */
    @RequestMapping("/selectPreviousRecord")
    public BaseResult selectPreviousRecord(Integer id) {
        return healthSummaryService.selectPreviousRecord(id);
    }

    /**
     * 查询不包括当前季度报告的 分页
     * @param page
     * @param id
     * @return
     */
    @RequestMapping("/selectHistoryPage")
    public BaseResult selectHistoryPage(Page page, Integer id) {
        return healthSummaryService.selectHistoryPage(page, id);
    }
}
